import {SET_USER,SET_TOKEN,SET_ROUTES,SET_MENU} from '../Types'
import {actionType} from '../../types'
const initDeault = {
    userInfo:{},
    token:'',
    menu:[],
    routes:[]
}

const reducer = (state=initDeault,action:actionType)=>{
    switch (action.type) {
        case SET_USER:
            return {...state,userInfo:action.payload}
       
        case SET_TOKEN:
            return {...state,token:action.payload}
        case SET_MENU:
            return {...state,menu:action.payload}
        case SET_ROUTES:
            return {...state,routes:action.payload}
        default:
        return state
    }
}
export default reducer;